<extend name="Base/common"/>

<block name="style">
    <link href="__CSS__/event.min.css" rel="stylesheet" type="text/css"/>
</block>
<block name="body">
<!--导航-->
<div id="main-container" class="container">

    <div class="my_event_main">
        <div class="my_nav">
            <ul class="nav nav-primary">
              <li><a href="{:U('index')}">我发布的活动 <span class="label label-badge label-info my_add_num">0</span></a></li>
              <li class="active"><a href="{:U('attend')}">我参与的活动 <span class="label label-badge label-info my_attend_num">0</span></a></li>
            </ul>
        </div>
        <div class="event_list_box row">
        <volist name="list" id="vo">
            <div class="col-md-3">
                <div class="event_item">
                <div class="img" style="padding: 0">
                    <if condition="time() lt $vo['eTime']">

                        <else/>
                        <div class="event_state">
                            已结束
                        </div>
                    </if>

                    <a href="{:U('Index/detail',array('id'=>$vo['id']))}">
                        <img class="" src="{$vo.cover_id|getThumbImageById=320,240}" />
                    </a>
                </div>
                <div class="content">
                    <div class="start_time">
                        {:date('Y-m-d H:i',$vo['sTime'])}
                    </div>
                    <h3 class="title">
                        <a href="{:U('Index/detail',array('id'=>$vo['id']))}" class="text-more">
                            {$vo.title}
                        </a>
                    </h3>
                    <div class="address text-ellipsis title="{$vo.province}{$vo.city}{$vo.district}{$vo.address}">
                        <i class="icon icon-map-marker"></i> {$vo.province}{$vo.city}{$vo.district}{$vo.address}
                    </div>
                    
                </div>
                </div>
            </div>
        </volist>
        
            <if condition="count($list) eq 0">
                <div >还没有参与过活动 ~ O(∩_∩)O~</div>
            </if>
        </div>
    </div>

    <div>
        <div class="text-center">
            {:getPagination($totalPageCount,$r)}
        </div>
    </div>

</div>

</block>

<block name="script">
<script>
$(function(){
    var url = U('Muuevent/Ajax/my_add');
    var totalCount=0;

    $.get(url, function (res) {
        if (res.status) {
            totalCount =  res.data.totalCount;
            $('.my_add_num').text(totalCount); 
        }
    });
});

$(function(){
    var url = U('Muuevent/Ajax/my_attend');
    var totalCount=0;

    $.get(url, function (res) {
        if (res.status) {
            totalCount =  res.data.totalCount;
            $('.my_attend_num').text(totalCount); 
        }
    });
});
</script>
</block>










